<template>
  <div>
    <div class="schoolList" v-for="(data, index) in schoolListArr" :key="index">
      <div class="flex">
        <div class="schoolList-Left">
          <div v-if="data.isNewly">
            <h1 style="font-size: 24px">新增</h1>
          </div>
          <div v-else>
            <div
              class="df"
              :class="{ disableUni: disableUniversityInfo }"
              @click="universityInfo(data, false)"
            >
              <h1 style="font-size: 35px">{{ data.chance }}</h1>
              <span>%</span>
            </div>

            <div class="schoolList-Left-size">
              {{ data.probabilityExplain }}
            </div>
          </div>
          <div
            :class="
              data.chance_lv == 1
                ? 'chance1'
                : data.chance_lv == 2
                  ? 'chance2'
                  : 'chance3'
            "
            class="schoolList-Left-number"
          >
            {{ data.chance_lv == 1 ? '冲' : data.chance_lv == 2 ? '稳' : '保' }}
          </div>
        </div>
        <div class="schoolList-Center" style="flex: 1 1 0%">
          <div
            class="schoolName"
            @click="handleScoolNameClick(data)"
            v-html="highlightTextCollage(data.collegeName)"
          ></div>
          <div
            class="schoolList-size"
            style="color: red"
            v-show="judgeStoreId(studentData.studentMobile)"
          >
            {{ data.enterYear }} | {{ data.enterScore }} |
            {{ data.enterRank }} | {{ data.enterType }} | {{ data.id }}
          </div>
          <div class="schoolList-size">
            <p>
              代码: {{ data.collegeEnrollCode }} |
              {{ data.features.join(' / ') }} |
              {{
                data.provinceName +
                ' ' +
                data.cityName +
                ' / ' +
                data.categories.join(' / ') +
                ' / ' +
                data.natureType +
                ' / ' +
                '排名' +
                (data.rank <= 0 ? '-' : data.rank)
              }}
            </p>
          </div>
        </div>
        <div class="schoolList-people" style="width: 128px">
          <div class="schoolList-Number">
            <span style="font-size: 35px">{{ data.planNum }}</span
            ><span style="font-size: 12px">人</span>
          </div>
          <!-- <div class="schoolList-title">物理+不限</div> -->
        </div>
        <div class="schoolList-grade" style="width: 420px">
          <div class="schoolList-grade-left" style="width: 20%">
            <div class="schoolList-grade-size">录取人数</div>
            <div class="schoolList-grade-size">线差</div>
            <div class="schoolList-grade-size">最低分</div>
            <div class="schoolList-grade-size">最低位次</div>
            <div class="schoolList-grade-size schoolList-grade-size-icon">
              <span>等效位差</span>
              <el-tooltip placement="top">
                <template #content>
                  什么是等效位差？
                  <br />
                  历年等效位差根据考生历年的等效位-历年位次的差值得出，
                  <br />
                  换算后的等效位差可更精准的与历年位次进行比较。
                </template>
                <QuestionFilled style="width: 12px; margin-left: 8px" />
              </el-tooltip>
            </div>
          </div>

          <div v-for="(moreItem, index) in data.moreYear" style="width: 27%">
            <div v-if="moreItem.hasPlan" class="schoolList-grade-left">
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.enterNum }}
              </div>
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.lineDiff || '-' }}
              </div>
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.minScore }}
                <div
                  v-if="
                    ((moreItem.zjText * 1 > 0 && moreItem.minScore * 1 > 0) ||
                      moreItem.zjText == '有征集') &&
                    moreItem.minScore !== '-'
                  "
                  style="background-color: #fbc7c2; color: red"
                >
                  征
                </div>
              </div>
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.minRank }}
              </div>
              <div class="schoolList-grade-size-number alitem">
                <template
                  v-for="(item, index) in getFormatEquivalentBitDifference(
                    moreItem.equivalentBitDifference
                  )"
                >
                  <span :style="{ color: item.color }">
                    {{ item.text }}
                  </span>
                </template>
              </div>
            </div>
            <div v-else class="schoolList-grade-left">
              <span
                class="schoolList-grade-size-number alitem"
                style="height: 100%"
                >未招生</span
              >
            </div>
          </div>
        </div>
        <div
          style="width: 10%; padding: 40px; cursor: pointer"
          class="alitem center"
        >
          <div>
            <el-dropdown>
              <span class="el-dropdown-link">
                <el-button
                  type="primary"
                  :class="
                    getFilledCollegeKey(data).length > 0
                      ? 'zyb-fill'
                      : 'zyb-notfill'
                  "
                  >填报为{{ getFilledCollegeKey(data) }}
                  <el-icon class="el-icon--right"><arrow-down /></el-icon>
                </el-button>
              </span>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item
                    v-for="(key, index) in volunteerKeys"
                    @click="
                      onClickVolunteerItem(getFilledCollegeKey(data), key, data)
                    "
                    command="a"
                    :style="getFilledKey(key) ? 'color: #165dff' : ''"
                  >
                    {{ key }}志愿
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
            <div
              class="schoolList-tzy-button alitem margintop"
              @click="onClickShowMajors(data)"
            >
              专业
              {{ data.majorsInfo ? data.majorsInfo.length : 0 }}
              <el-icon size="20">
                <ArrowDown v-if="!isShowMajors(data)" />
                <ArrowUp v-else />
              </el-icon>
            </div>
          </div>
        </div>
      </div>
      <div
        v-if="isShowMajors(data)"
        style="
          width: 100%;
          background-color: #fafbfe;
          display: flex;
          border-bottom: 1px solid #e5e6eb;
        "
        v-for="(major, index) in data.majorsInfo"
        :key="index"
      >
        <div class="schoolList-Left">
          <div v-if="major.isNewly">
            <h1 style="font-size: 24px">新增</h1>
          </div>
          <div v-else>
            <div
              class="df"
              :class="{ disableUni: disableUniversityInfo }"
              @click="universityInfo(major, true)"
            >
              <h1 style="font-size: 35px">{{ major.chance }}</h1>
              <span>%</span>
            </div>
            <div class="schoolList-Left-size">
              {{ major.probabilityExplain }}
            </div>
          </div>
        </div>
        <div
          class="schoolList-Center curr"
          style="flex: 1 1 0%"
          @click="handleMajor(major)"
        >
          <div
            class="schoolName-size"
            v-html="
              highlightTextMajor(major.professionRealName, major.majorCode)
            "
          ></div>
          <div
            class="schoolList-size"
            style="color: red"
            v-show="judgeStoreId(studentData.studentMobile)"
          >
            {{ major.enterYear }} | {{ major.enterScore }} |
            {{ major.enterRank }} | {{ major.enterType }} | {{ major.id }}
          </div>
          <div style="font-size: 12px; margin-left: 20px">
            {{ major.remarkExt }}
          </div>
          <div class="schoolList-size">
            <div>
              代码:
              {{
                major.professionEnrollCode ? major.professionEnrollCode : '-'
              }}
              <span v-if="!!major.mseLevel"> | </span>
              <span v-if="!!major.mseLevel" class="mseLevel">{{
                major.mseLevel
              }}</span>
            </div>
          </div>
        </div>
        <div class="schoolList-people" style="width: 128px">
          <div class="schoolList-Number">
            <span style="font-size: 35px">
              {{ major.planNum ? major.planNum : '-' }} </span
            ><span style="font-size: 12px">人</span>
          </div>
          <div class="schoolList-title">
            {{
              (major.learnYear ? major.learnYear : '-') +
              '年 ￥' +
              (major.cost ? major.cost : '-')
            }}
          </div>
          <!-- <div class="schoolList-title">物理+不限</div> -->
        </div>
        <div class="schoolList-grade" style="width: 420px">
          <div class="schoolList-grade-left" style="width: 20%">
            <div class="schoolList-grade-size">录取人数</div>
            <div class="schoolList-grade-size">线差</div>
            <div class="schoolList-grade-size">最低分</div>
            <div class="schoolList-grade-size">最低位次</div>
            <div class="schoolList-grade-size schoolList-grade-size-icon">
              <span>等效位差</span>
              <el-tooltip placement="top">
                <template #content>
                  什么是等效位差？
                  <br />
                  历年等效位差根据考生历年的等效位-历年位次的差值得出，
                  <br />
                  换算后的等效位差可更精准的与历年位次进行比较。
                </template>
                <QuestionFilled style="width: 12px; margin-left: 8px" />
              </el-tooltip>
            </div>
          </div>
          <div v-for="(moreItem, index) in major.moreYear" style="width: 27%">
            <div v-if="moreItem.hasPlan" class="schoolList-grade-left">
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.enterNum }}
              </div>
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.lineDiff || '-' }}
              </div>
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.minScore }}
                <div
                  v-if="
                    ((moreItem.zjText * 1 > 0 && moreItem.minScore * 1 > 0) ||
                      moreItem.zjText == '有征集') &&
                    moreItem.minScore !== '-'
                  "
                  style="background-color: #fbc7c2; color: red"
                >
                  征
                </div>
              </div>
              <div class="schoolList-grade-size-number alitem">
                {{ moreItem.minRank }}
              </div>
              <div class="schoolList-grade-size-number alitem">
                <template
                  v-for="(item, index) in getFormatEquivalentBitDifference(
                    moreItem.equivalentBitDifference
                  )"
                >
                  <span :style="{ color: item.color }">
                    {{ item.text }}
                  </span>
                </template>
              </div>
            </div>
            <div v-else class="schoolList-grade-left">
              <span
                class="schoolList-grade-size-number alitem"
                style="height: 100%"
                >未招生</span
              >
            </div>
          </div>
        </div>
        <div
          style="
            width: 10%;
            padding: 40px;
            cursor: pointer;
            display: flex;
            flex-direction: column;
          "
        >
          <div
            class="schoolList-look-button alitem"
            style="width: 60px"
            :class="getFilledMajorIndex(data, major) > 0 ? 'select' : ''"
            @click="onClickTianbao(data, major)"
          >
            {{
              getFilledMajorIndex(data, major) > 0
                ? '已填' + getFilledMajorIndex(data, major)
                : '填报'
            }}
          </div>
          <span
            v-if="data.majorEnrollTypesLable"
            style="font-size: 14px; color: #ff7d00"
            >{{ major.majorEnrollTypesLable }}</span
          >
        </div>
      </div>
    </div>

    <el-dialog v-model="dialogVisible" title="提示" width="500">
      <span>{{ tipsString }}</span>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="dialogVisible = false">取消</el-button>
          <el-button type="primary" @click="confirmReplacementSchool">
            确定
          </el-button>
        </div>
      </template>
    </el-dialog>
    <Drawertool ref="drawertoolRef" />
  </div>
</template>
<script setup>
import Drawertool from '@/components/Drawertool';
import bus from '@/utils/bus.js';

import { nextTick, reactive, watch } from 'vue';
import volunteersStore from '@/store/modules/volunteerInfos';
import { searchMajor } from '@/api/appv2/appv1.js';
import { ElMessage } from 'element-plus';
import { computed } from 'vue';

import { safeFormatEquivalentBitDifference } from '@/utils/formatEquivalentBitDifference.js';
const drawertoolRef = ref(null);
const volunteerStore = volunteersStore();
const emit = defineEmits();

const props = defineProps({
  // 院校列表数据
  schoolListArr: {
    type: Array,
    default: () => [],
  },
  // 可填写志愿表数量
  volunteerNumber: {
    type: [String, Number],
    default: 0,
  },
  studentData: {
    type: Object,
    default: () => ({}),
  },
  //true禁止弹窗
  disableUniversityInfo: {
    type: Boolean,
    default: true,
  },
  // 筛选条件
  userSearchDate: {
    type: Array,
    default: () => [],
  },
  // 高亮院校名称
  highlightTextCollage: {
    type: Function,
    required: true,
  },
  // 高亮专业名称
  highlightTextMajor: {
    type: Function,
    required: true,
  },
});

// 动态获取等效位差的页面结构
const getFormatEquivalentBitDifference = (val) => {
  return safeFormatEquivalentBitDifference(val);
};

const storeid = ref(JSON.parse(localStorage.getItem('userDateInfo'))?.storeId);
// 判断用户信息和机构id是否符合
const judgeStoreId = (phone) => {
  return phone.includes('00000000') && storeid.value == 1;
};

const dialogVisible = ref(false);
const tipsString = ref('');

watch(
  () => props.volunteerNumber,
  () => {
    getVolunteerDataNumber();
  }
);

const majorLeavel = ref('');
const fetcSearchMajor = (major) => {
  let data = {
    search: major.professionRealName,
    code: major.majorCode,
  };
  searchMajor(data).then((res) => {
    if (res.code == 20000) {
      majorLeavel.value = res.data[0].level;
      major.level = majorLeavel.value - 1;

      localStorage.setItem('student_id', props.studentData.studentId);
      drawertoolRef.value.handleChangeDrawer(true, '3-1');
      nextTick(() => {
        bus.emit('handleOpenMajorDet', major);
      });
    }
  });
};

// 大学名称点击
const handleScoolNameClick = (data) => {
  localStorage.setItem('provinceId', props.studentData.gkaProvinceNumId);
  localStorage.setItem('student_id', props.studentData.studentId);
  drawertoolRef.value.handleChangeDrawer(true, '3', data);
};
// 大学下面的专业名称点击
const handleMajor = (major) => {
  fetcSearchMajor(major);
};

// 可填报志愿表key：[A-Z]
const volunteerKeys = ref([]);
// 当前填报志愿表数据：[{},{}, ... ,{}]
const volunteerInfos = ref(
  computed(() =>
    volunteerStore.volunteerInfos.length ? volunteerStore.volunteerInfos : []
  )
);
// const volunteerInfos = ref(computed(() => volunteerStore.volunteerInfos.length == 0 ? {} : volunteerStore.volunteerInfos))
// 展开查看专业列表的学校ID数组
const showMajorsSchoolIDs = ref([]);
// 弹出询问是否替换志愿表时的临时存放数据
const tempData = reactive({
  oldKey: '', //原有的志愿表key
  key: '', //即将切换的志愿表key
  data: {}, //填报的学校数据
});

/*
 * 根据四川高考类型可填报志愿表数量获取相同数量的志愿表key：A-Z，例如四川志愿表数量为9，volunteerKeys等于A-I
 * props.volunteerNumber 可填报志愿表数量
 */
function getVolunteerDataNumber() {
  const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  const numKeys = Math.ceil(props.volunteerNumber / 26);

  for (let i = 0; i < props.volunteerNumber; i++) {
    let letterIndex = i % 26;
    let key =
      alphabet[letterIndex] + (numKeys === 1 ? '' : Math.floor(i / 26 + 1));
    volunteerKeys.value.push(key);
  }
}

// 点击展开收起专业列表
function onClickShowMajors(data) {
  const index = showMajorsSchoolIDs.value.indexOf(data.id);
  if (index >= 0) {
    showMajorsSchoolIDs.value.splice(index, 1);
  } else {
    showMajorsSchoolIDs.value.push(data.id);
  }
}

// 是否展开专业列表
function isShowMajors(data) {
  return showMajorsSchoolIDs.value.includes(data.id);
}

// 是否已填志愿表并返回填报的志愿表Key
function getFilledCollegeKey(data) {
  const filledItem = volunteerInfos.value.find((item) => item.id === data.id);
  return filledItem ? filledItem.vkey : '';
}

// 是否已填志愿表
function getFilledKey(key) {
  return volunteerInfos.value.some((data) => data.vkey.includes(key));
}

/*
 * 点击志愿表选项
 * oldKey: 原有的志愿表key
 * key: 即将切换的志愿表key
 * data: 填报的学校数据
 */
function onClickVolunteerItem(oldKey, key, data) {
  if (oldKey === key) return;

  const toVolunteer =
    volunteerInfos.value.find((item) => item.vkey === key) || {};
  const oldVolunteer =
    volunteerInfos.value.find((item) => item.vkey === oldKey) || {};
  let volunteer = {
    ...data,
    majorsInfo:
      oldVolunteer.majorsInfo?.length > 0 ? oldVolunteer.majorsInfo : [],
  };

  if (toVolunteer.vkey) {
    // 当前的选择有数据;提示更换
    Object.assign(tempData, { oldKey, key, data });
    tipsString.value = `${key}志愿已选择 ${toVolunteer.collegeName} 是否替换为 ${data.collegeName}`;
    dialogVisible.value = true;
    return;
  }

  if (oldVolunteer.vkey) {
    // 清理旧数据
    let index = volunteerInfos.value.findIndex((item) => item.vkey == oldKey);
    volunteerInfos.value.splice(index, 1);
    // 准备新的志愿者信息
    volunteerInfos.value = volunteerInfos.value.filter(
      (item) => item.vkey !== oldKey
    );
  }

  // 添加新的志愿者信息
  volunteer.vkey = key;
  volunteerInfos.value.push(volunteer);
  showMajorsSchoolIDs.value.push(data.id);

  // 排序
  volunteerInfos.value.sort((a, b) => a.vkey.localeCompare(b.vkey));

  volunteerStore.setVolunteerInfos([...volunteerInfos.value]);
}

// 确认替换院校
function confirmReplacementSchool() {
  // 提取数据和键
  const { data, oldKey, key } = tempData;

  // 复制数据并初始化志愿信息
  const volunteer = { ...data };
  const oldVolunteer =
    volunteerInfos.value.find((item) => item.vkey === oldKey) || {};
  volunteer.majorsInfo =
    oldVolunteer.majorsInfo?.length > 0 ? oldVolunteer.majorsInfo : [];

  // 清除原有志愿表信息
  const toIndex = volunteerInfos.value.findIndex((item) => item.vkey === key);
  if (toIndex !== -1) {
    volunteerInfos.value.splice(toIndex, 1);
  }

  // 清除将要移动的志愿学校信息
  const moveIndex = volunteerInfos.value.findIndex(
    (item) => item.vkey === oldKey
  );
  if (moveIndex !== -1) {
    volunteerInfos.value.splice(moveIndex, 1);
  }

  // 添加展开专业列表的学校ID
  showMajorsSchoolIDs.value.push(data.id);

  // 设置新的志愿表
  volunteer.vkey = key;
  volunteerInfos.value.push(volunteer);

  // 排序
  volunteerInfos.value.sort((a, b) => a.vkey.localeCompare(b.vkey));

  // 更新到 store
  volunteerStore.setVolunteerInfos(volunteerInfos.value);

  // 隐藏对话框
  dialogVisible.value = false;
}

// 点击填报按钮 data:学校数据  major:专业数据
function onClickTianbao(data, major) {
  const volunteer = volunteerInfos.value.find((item) => item.id === data.id);

  if (volunteer) {
    // 已填报学校，判断填报or取消填报专业
    const majorsInfo = volunteer.majorsInfo || [];
    const mIndex = majorsInfo.findIndex((item) => item.id === major.id);

    if (mIndex >= 0) {
      majorsInfo.splice(mIndex, 1);
    } else {
      majorsInfo.push(major);
    }

    // 更新志愿表数据
    volunteer.majorsInfo = majorsInfo;
    volunteerInfos.value.splice(
      volunteerInfos.value.indexOf(volunteer),
      1,
      volunteer
    );
  } else {
    // 未填报学校，提示请选择学校
    ElMessage({
      message: '请先选择学校',
      type: 'warning',
    });
  }

  volunteerStore.setVolunteerInfos(volunteerInfos.value);
}
const universityInfo = (data, isMajor) => {
  emit('universityInfo', data, isMajor);
};
// 判断是否填报专业并返回当前填报专业数量
function getFilledMajorIndex(data, major) {
  const fillKey = getFilledCollegeKey(data);
  const foundVolunteer = volunteerInfos.value.find(
    (item) => item.vkey === fillKey
  );
  const majorsInfo = (foundVolunteer && foundVolunteer.majorsInfo) || [];
  const index = majorsInfo.findIndex((item) => item.id === major.id);

  return index + 1;
}
</script>
<style lang="scss" scoped>
:deep(.el-tooltip__trigger:focus-visible) {
  outline: unset;
}
.df {
  align-items: baseline;
  cursor: pointer;
  width: fit-content;
}
.disableUni {
  pointer-events: none;
  cursor: default;
}

.schoolList {
  display: flex;
  flex-direction: column;
  border-right: none;
  background: #fff;
  position: relative;
  border-bottom: 1px solid #e5e6eb;

  .schoolList-tzy-button {
    color: #165dff;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
  }

  .schoolList-look-button {
    color: #165dff;
    width: 90px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #165dff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
  }

  .schoolList-look-button.select {
    color: white;
    background-color: #165dff;
  }

  .schoolList-grade {
    display: flex;

    .schoolList-grade-left {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 100%;

      .schoolList-grade-size {
        height: 25%;
        padding: 10px 5px;
        text-align: left;
        font-size: 12px;
        font-weight: 400;
        line-height: 12px;
        border-bottom: 1px solid #f2f3f5;
        border-right: 1px solid #f2f3f5;
      }

      .schoolList-grade-size-number {
        height: 20%;
        padding: 10px 5px;
        text-align: left;
        font-size: 12px;
        font-weight: 400;
        line-height: 12px;
        border-bottom: 1px solid #f2f3f5;
        border-right: 1px solid #f2f3f5;
        padding-left: 10px;
      }

      .schoolList-grade-size-icon {
        align-items: center;
        display: flex;
        flex-direction: row;
      }
    }
  }

  .schoolList-people {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 18px 0;
    border-right: 1px solid #e5e6eb;

    .schoolList-Number {
      text-align: center;
      font-size: 20px;
      font-weight: 400;
      color: #1d2129;
      line-height: 24px;
    }

    .schoolList-title {
      font-size: 12px;
      font-weight: 400;
      color: #86909c;
      line-height: 1.5;
    }
  }

  .schoolList-Center {
    min-width: 100px;
    margin-bottom: 10px;

    .schoolName {
      cursor: pointer;
      font-size: 18px;
      font-weight: 500;
      color: #1d2129;
      line-height: 27px;
      margin-left: 20px;
      margin-top: 20px;
    }

    .schoolName-size {
      font-size: 14px;
      font-weight: 400;
      color: #1d212c;
      line-height: 27px;
      margin-left: 20px;
      margin-top: 20px;
    }

    .schoolList-size {
      font-size: 12px;
      font-weight: 400;
      color: #86909c;
      line-height: 24px;
      display: flex;
      margin-left: 20px;
      align-items: center;

      .mseLevel {
        background-color: #fbe6e8;
        padding: 2px 4px;
        font-size: 10px;
        color: #f54f4a;
      }
    }

    .schoolList-bottom {
      display: flex;
      margin-left: 20px;
      margin-top: 10px;
      margin-bottom: 10px;

      .schoolList-bottom-size {
        background: #fff;
        border-radius: 2px 2px 2px 2px;
        border: 1px solid #bcc3cc;
        font-size: 12px;
        font-weight: 400;
        color: #86909c;
        padding: 0 4px;
        margin: 0 4px;
      }
    }
  }

  .schoolList-Left {
    width: 6%;
    padding: 18px 0 18px 20px;
    border-right: 1px solid #f2f3f5;

    .schoolList-Left-size {
      text-align: left;
      font-size: 12px;
      font-family:
        PingFang SC-Regular,
        PingFang SC;
      font-weight: 400;
      color: #86909c;
      line-height: 12px;
    }

    .schoolList-Left-number {
      width: 20px;
      height: 20px;
      margin-top: 12px;
      // background-color: #F53F3F;
      text-align: center;
      line-height: 20px;
      border-radius: 4px;
      color: #fff;
    }
  }

  .zyb-fill {
    background-color: #165dff;
    color: white;
  }

  .zyb-notfill {
    background-color: transparent;
    color: #165dff;
    border: #165dff 2rpx solid;
  }

  .zyb-key-sel {
    color: #165dff;
  }
}

.chance1 {
  background-color: #f53f3f;
}

.chance2 {
  background-color: #ff8c33;
}

.chance3 {
  background-color: #00bf10;
}
</style>
